package com.wk.database;

import com.wk.database.entity.definition.Column;
import com.wk.database.entity.definition.ColumnType;
import com.wk.database.entity.definition.Condition;
import com.wk.database.entity.definition.Table;

@Table("t_business_computing_resource_management")
public class SlaveMachine {
	public SlaveMachine() {
	}

	public boolean isOnline() {
		return state.equals(MachineState.NORMAL);
	}

	@Override
	public String toString() {
		return "[" + type + "]" + ip + "：" + state;
	}

	@Column(name = "resource_type", type = ColumnType.STRING)
	@Condition("= '从节点'")
	public String type;

	@Column(name = "resource_ip_address", type = ColumnType.STRING)
	public String ip;

	@Column(name = "machine_status", type = ColumnType.STRING)
	@Condition("!= '" + MachineState.DEPRECATED + "'")
	public String state;
}
